<?php
namespace Admins\Model;
use Think\Model;
class SysModel extends Model {
protected $tableName = 'user';
	
	protected $_validate = array(		
		array('Username','require','用户名必须填写'),
		array('Password','require','密码必须填写')

	);	
		
	public function userLogin($username='',$password='')
	{//用户登录
		
		$password = md5($password);
$data = $this->query("select `id`,`turename`,`username` from ".C('DB_PREFIX')."user where `username`='%s' and `passwords`='%s'",array($username,$password));
		//var_dump($data);
		if($data)
		{
			return $data[0];
		}
		else
		{
			return false;
		}	
	
	}
	



}


?>